package com.xm.common;

import java.net.http.HttpClient;

/**
 * 单例模式
 */
public class HttpSingleton {
    private static HttpClient INSTANCE = null;
    private HttpSingleton() {}
    public static HttpClient getInstance(){
        if (INSTANCE == null){
            synchronized (HttpSingleton.class){
                INSTANCE = HttpClient.newHttpClient();
            }
        }
        return INSTANCE;
    }
}
